﻿using System;
using Autodesk.Revit.DB;

namespace YJKSparseDistance.ModelLayer
{
	public class CurveBoundingXYPlane
	{
		public double maxX
		{
			get
			{
				return this.m_dmaxX;
			}
		}

		public double minX
		{
			get
			{
				return this.m_dminX;
			}
		}

		public double maxY
		{
			get
			{
				return this.m_dmaxY;
			}
		}

		public double minY
		{
			get
			{
				return this.m_dminY;
			}
		}

		public bool IfCanUse
		{
			get
			{
				return this.m_bIfCanUse;
			}
		}

		public CurveBoundingXYPlane(Curve input)
		{
			if (input is Line)
			{
				Line line = input as Line;
				this.m_dmaxX = Math.Max(line.GetEndPoint(0).X, line.GetEndPoint(1).X);
				this.m_dminX = Math.Min(line.GetEndPoint(0).X, line.GetEndPoint(1).X);
				this.m_dmaxY = Math.Max(line.GetEndPoint(0).Y, line.GetEndPoint(1).Y);
				this.m_dminY = Math.Min(line.GetEndPoint(0).Y, line.GetEndPoint(1).Y);
				this.m_bIfCanUse = true;
			}
		}

		private double m_dmaxX = -1.0;

		private double m_dminX = -1.0;

		private double m_dmaxY = -1.0;

		private double m_dminY = -1.0;

		private bool m_bIfCanUse;
	}
}
